package com.lecyon.farm.entity.elasticsearch;

import com.google.common.base.Objects;
import io.swagger.annotations.ApiModel;
import lombok.Data;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;

import javax.persistence.Id;

/**
 * @author Yao Zheng
 * @Date 2020/4/20 14:46
 */
@Data
@ApiModel("图片信息")
@Document(indexName = "gps_pic_info", type = "picinfo2020")
public class GpsPictureInformation {

    @Id
    private String id;

    @Field
    private String picUrl;

    @Field
    private String fileName;

    @Field
    private String gpsLon;

    @Field
    private String gpsLat;

    @Field
    private String carId;

    @Field
    private String createDate;

    @Field
    private String time;

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        GpsPictureInformation that = (GpsPictureInformation) o;
        return Objects.equal(picUrl, that.picUrl) &&
                Objects.equal(fileName, that.fileName) &&
                Objects.equal(gpsLon, that.gpsLon) &&
                Objects.equal(gpsLat, that.gpsLat) &&
                Objects.equal(carId, that.carId) &&
                Objects.equal(createDate, that.createDate) &&
                Objects.equal(time, that.time);
    }

    @Override
    public int hashCode() {
        return Objects.hashCode(picUrl, fileName, gpsLon, gpsLat, carId, createDate, time);
    }

}
